function ie_flash() {
	theObjects = document.getElementsByTagName("object");
	for (var i = 0; i < theObjects.length; i++) { theObjects[i].outerHTML = theObjects[i].outerHTML; }
}

function popup(src, w, h, unique, scrollbars) {
	if (w == null) w = 450;
	if (h == null) h = 550;
	
	if (!scrollbars)
		scrollbars = 'no';
	else
		scrollbars = 'yes';
	
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	
	var wname = (unique) ? 'myPopup' : '';
	window.open(src, wname, 'scrollbars='+ scrollbars +',width='+w+',height='+h+', top='+ wint +',left='+ winl);
}

function popup_image(imageName,alt) {
  newWindow = window.open("","newWindow","scrollbars=no");
  newWindow.document.open();
  newWindow.document.write('<html>');
  newWindow.document.write('<script language="javascript">\n');
  newWindow.document.write('var NS = (navigator.appName=="Netscape")?true:false;\n');
  newWindow.document.write('function FitPic(){iWidth = (NS)?window.innerWidth:document.body.clientWidth; iHeight = (NS)?window.innerHeight:document.body.clientHeight; iWidth = document.images[0].width - iWidth; iHeight = document.images[0].height - iHeight; window.resizeBy(iWidth, iHeight); self.focus(); };')
  newWindow.document.write('</script>');
  newWindow.document.write('<title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onLoad="FitPic()" onBlur="self.close()">'); 
  newWindow.document.write('<img src=\"'+imageName+'\" alt=\"'+alt+'\" name=\"imgz\">');
  newWindow.document.write('</body></html>');
  newWindow.document.close();
  newWindow.focus();
}

function toggle(id) {
	var d = document.getElementById(id);
	d.style.display = (d.style.display == 'none') ? 'block' : 'none';
}

function do_rollovers() {
	if (!document.getElementById) return
		var imgOriginSrc;
		var imgTemp = new Array();
		var imgarr = document.getElementsByTagName('img');
		
		for (var i = 0; i < imgarr.length; i++) {
			if (imgarr[i].getAttribute('hsrc')) {
				imgTemp[i] = new Image();
				imgTemp[i].src = imgarr[i].getAttribute('hsrc');
				
				imgarr[i].onmouseover = function() {
					imgOriginSrc = this.getAttribute('src');
					this.setAttribute('src',this.getAttribute('hsrc'))
				}
				
				imgarr[i].onmouseout = function() {
					this.setAttribute('src',imgOriginSrc)
				}
				
			}
		}
}

function copy2clipboard(s) {
	if (window.clipboardData && clipboardData.setData )	{
		clipboardData.setData("Text", s);
	}	else {
		user_pref("signed.applets.codebase_principal_support", true);
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
		var clip = Components.classes['@mozilla.org/widget/clipboard;[[[[1]]]]'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip) return;
		var trans = Components.classes['@mozilla.org/widget/transferable;[[[[1]]]]'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) return;
		trans.addDataFlavor('text/unicode');
		var str = new Object();
		var len = new Object();
		var str = Components.classes["@mozilla.org/supports-string;[[[[1]]]]"].createInstance(Components.interfaces.nsISupportsString);
		var copytext=meintext;
		str.data=copytext;
		trans.setTransferData("text/unicode",str,copytext.length*[[[[2]]]]);
		var clipid=Components.interfaces.nsIClipboard;
		if (!clip) return false;
		clip.setData(trans,null,clipid.kGlobalClipboard);	   
	}
}

function vScroll(content,container,speed) {
	var content = document.getElementById(content);
	var container = document.getElementById(container);
	var interval;
	
	if (speed == null) var speed = 2;
	
	content.style.top = container.style.height;
	
	var move = function() { 
		interval = setInterval(
			function() {
				var actual_top = content.style.top.substr(0,content.style.top.length - 2);
				if (-(actual_top) > content.offsetHeight) content.style.top = container.style.height;
				else content.style.top = (actual_top - 1) + "px";
			}
		,Math.round(40 / speed));
	}
	
	var stop = function() { clearInterval(interval); }
	
	container.onmouseover = function() { stop(); }
	container.onmouseout = function() { move(); }
	
	move();
}

function view_props(obj) {
	for (prop in obj)
		alert('Property: '+ prop +'\nValue: '+ obj[prop]);
}

Array.prototype.in_array = function (value) {
	var i;
	for (i=0; i < this.length; i++) {
		if (this[i] === value) {
			return true;
		}
	}
	return false;
};